
# #在括号内填写 父类名
# class father(父类1, 父类2,...):
#     #类内容体

# #父类
# class Father_1:
#     a = None
#
#     def Fun_1(self):
#         print("父类")
#         self.a = 1
#         print(self.a)
#
#
# #子类
# class Brother(Father_1):
#     b = None
#     def Fun_2(self):
#         print("子类")
#         self.b = 2
#
#         #使用父类的成员变量
#         print(Father_1.a)
#         #使用父类的成员方法 要传参self
#         Father_1.Fun_1(self)
#
#
# test_1 = Brother()
# #调用自己的成员方法
# test_1.Fun_2()

# #调用父类的成员方法
# test_1.Fun_1()

# class Father:
#     n = 1
#     def Fun(self):
#         print("父类")
#
#
# class Brother(Father):
#     def Fun(self):
#         print("子类")
#         print()
#
#         #方式一调父类成员
#         print(Father.n)
#         Father.Fun(self)
#         print()
#
#         #方法二调用父类成员
#         print(super().n)
#         super().Fun()
#
#
#
# test = Brother()
# test.Fun()

# class Father_1:
#     def Fun(self):
#         print("父类一")
#
#
# class Father_2:
#     def Fun(self):
#         print("父类二")
#
# class Brother(Father_1, Father_2):
#     def Fun(self):
#         print("子类")
#
#
# test = Brother()
# # 调用和父类的一样成员方法 ，调用的是自己的
# test.Fun()
# # 调用父类二
# test.Fun_2()
# # 调用子类
# test.Fun_3()

# def 函数(方法)名(形参 :类型, 形参 :类型,........) -> 返回值类型 :
#     #...
#
# a = 1
# b = 2
#
# c = Fun(a, b)
# print(c)

# def Fun(a, b):
#     return a + b
#
# a = 1
# b = 2
#
# c = Fun()

# # #变量类型注解
# a :int = 1
# b :float = 1.0
# c :str = "1234"
# d :bool = True
#
# #类对象类型注解
# class Test:
#     pass
#
# test :Test = Test()

# #变量类型注解
# a  = 1      # type: int
# b  = 1.0    # type: float
# c = "1234"  # type: str
# d  = True   # type: bool
#
# #类对象类型注解
# class Test:
#     pass
#
# test = Test()  # type: Test

# # #变量类型注解
# a :int = 1
# b :int = 1.0
# c :int = "1234"
# d :int = True

# my_list :list[int] = [1, 2, 3, 4]
#
# my_dict :dict[str,int] = {"age" :19, "id" : 1234}

# #导包
# from typing import Union
#
# #                    多个类型                多个类型
# my_list :list[ Union[int, float] ]= [1, 2, 3, 4.0, 5.0]
#
# #             str 配多个类型
# my_dict :dict[str,Union[int, str]] = {"age" :19, "id" : 1234, "name" : "张三"}

#老师布置的英语作业
class homework:
    def English(self):
        pass

#同学接收到作业后开始写
class student_1(homework):
    def English(self):
        print("student_1 英语的方法")

#同学接收到作业后开始写
class student_2(homework):
    def English(self):
        print("student_2 英语的方法")

#同样的行为（函数），传入不同的对象，得到不同的状态
#展示出学生的作业
def Fun(student : homework):
    student.English()


#创建对象
stu_1 = student_1()
stu_2 = student_2()

#调用函数
Fun(stu_1)
Fun(stu_2)

class homework:
    #语文
    def Chinses(self):
        pass
   #数学
    def Math(self):
        pass
   #英语
    def English(self):
        pass


class student_1(homework):
    def Chinese(self):
        print("student_1 语文的方法")

    def Math(self):
        print("student_1 数学的方法")

    def English(self):
        print("student_1 英语的方法")


class student_2(homework):
    def Chinese(self):
        print("student_2 语文的方法")

    def Math(self):
        print("student_2 数学的方法")

    def English(self):
        print("student_2 英语的方法")

        def Fun(student: homework):
            student.English()


def Fun_Chinese(student : homework):
    student.Chinese()


def Fun_Math(student : homework):
    student.Math()


def Fun_English(student : homework):
    student.English()


#创建对象
stu_1 = student_1()
stu_2 = student_2()

#每位同学的语文
Fun_Chinese(stu_1)
Fun_Chinese(stu_2)

#每位同学的数学
Fun_Math(stu_1)
Fun_Math(stu_2)

#每位同学的英语
Fun_English(stu_1)
Fun_English(stu_2)